package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `json:"username"`
	Password string `json:"password"`
}
type News struct {
	gorm.Model
	Title     string `json:"title"`
	Content   string `json:"content"`
	Img       string `json:"img"`
	UserId    int    `json:"user_id"`
	User      User   `gorm:"foreignKey:UserId"`
	LikeCount int    `json:"like_count"`
}
type Like struct {
	gorm.Model
	UserId int  `json:"user_id"`
	NewsId int  `json:"news_id"`
	User   User `gorm:"foreignKey:UserId"`
	News   News `gorm:"foreignKey:NewsId"`
}
